<extend name="Base/base" />
<block name='head'>
    <link rel="stylesheet" type="text/css" href="/Public/Admin/css/kaoqin.css"/>
    <link rel="stylesheet" type="text/css" href="/Public/Admin/css/main.css"/>
    <style>
        table{
            table-layout: fixed;
        }
        td{
            height: 60px;
            white-space: nowrap;/*控制单行显示*/
            overflow: hidden;/*超出隐藏*/
            text-overflow: ellipsis;/*隐藏的字符用省略号表示*/
        }
        .operate{color: #1781d0;}
    </style>
</block>
<block name="content" >
    <section class="layui-larry-box mian-page page-attendanceStatistics">
	<div class="larry-personal">
            <div class="layui-tab">
                <blockquote class="layui-elem-quote news_search">
                    <form method="get" id='form'>
                        <div class="layui-inline">
                            <span class="btn-upload form-group">
                                <select name="type_id" class="layui-input search_input type_id" data-model='news_manage' style="width:150px">
                                    <option value="">所有类型</option>
                                    <foreach name="news_code" item="code">
                                        <option value="{$code.code_no}" {$type_id == $code['code_no'] ? 'selected' : ''}>{$code.code_name}</option>
                                    </foreach>
                                </select>
                            </span>
                        </div>
                        <div class="layui-inline">
                            <input type="hidden" name="p" value="1" />
                            <a class="layui-btn search_btn categoryBtn" data-ctrl="news" style="margin-left:10px;"> 添加类型</a>
                            <a class="layui-btn search_btn search" data-url="{:U('newsManage')}" style="margin-left:10px;"> 查询</a>
                        </div>
                        
                    </form>
                </blockquote>
                <div class="layui-block" style="text-align:right;margin-top:15px;">
                    <a class="layui-btn search_btn search" href="{:U('saveNews')}" style="margin-left:10px;">新建新闻</a>
                </div>
                <div class="layui-tab-content larry-personal-body clearfix mylog-info-box tabRedefine layui-tab-brief">
                    <div class="layui-tab-item layui-field-box layui-show absence">
			<table class="layui-table setTabBg out" lay-skin="line">
                            <thead>
                                    <tr>
                                        <th width="3%"><input type="checkbox" name="all" value=""></th>
                                        <th width="8%">发布人</th>
                                        <th width="8%">类型</th>
                                        <th width='15%'>发布范围</th>
                                        <th width="20%">标题</th>
                                        <th width="15%">发布时间</th>
                                        <th width="10%">点击数</th>
                                        <th width="10%">评论（条）</th>
                                        <th width="15%">操作</th>
                                    </tr>
                            </thead>
                            <tbody id="tb">
                                <notempty>
                                    <foreach name='news' item='data'>
                                        <tr>
                                            <td><input class="more" name="news_id[]" type="checkbox" value="{$data.news_id}"></td>
                                            <td>{$data.provider|getChineseName}</td>
                                            <td>{$data.type_id|getNewsTypeName}</td>
                                            <td align='left' style="width:10%;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;" title='部门：{$data.to_id}<if condition="$data['priv_id'] neq ''">&nbsp;&nbsp;角色：{$data.priv_id}</if><if condition="$data['user_id'] neq ''">&nbsp;&nbsp;人员：{$data.user_id}</if>'>
                                                <font style="color:#1781d0;font-weight:bolder;">部门：</font>{$data.to_id}
                                                <if condition="$data['priv_id'] neq ''">
                                                    <font style="color:#1781d0;font-weight:bolder;">角色：</font>{$data.priv_id}
                                                </if>
                                                <if condition="$data['user_id'] neq ''">
                                                    <font style="color:#1781d0;font-weight:bolder;">人员：</font>{$data.user_id}
                                                </if>
                                            </td>
                                            <td align='left' title="{$data.subject}">
                                                <a href='{:U("Personal/readNews",array("news_id"=>$data["news_id"],"type_id"=>$_GET["type_id"],"is_manage"=>1))}' style="color:#1781d0;">
                                                    {$data.subject}
                                                </a>
                                            </td>
                                            <td>{$data.news_time}</td>
                                            <td>{$data.click_count}</td>
                                            <td>{$data.comment_count}</td>
                                            <td>
                                                <a class="pointer operate editNews" href="{:U('saveNews',array('news_id'=>$data['news_id'],'type_id'=>$type_id))}">修改</a>
                                                <a class="pointer operate delData" data-url='{:U("delNews",array("news_id"=>$data["news_id"]))}'>删除</a>
                                            </td>
                                        <tr>
                                    </foreach>
                                </notempty>
                            </tbody>
			</table>
                    </div>
                    <a class="layui-btn search_btn delMore" data-url="{:U('delMore',array('type'=>'news'))}" style="margin-left:10px;"> 批量删除</a>
                    <div class="layui-block">共{$count}条数据</div>
                    <div class="larry-table-page clearfix">
                        <div id="page" class="page">{$page}</div>
                    </div>
                </div>
            </div>
        </div>
    </section>
</block>
<block name="script">
    <script type="text/javascript" src="/Public/Admin/js/erp.js"></script>
    <script type="text/javascript" src="/Public/Admin/js/common.js" ></script>
    <script type="text/javascript">
        $(initAddCate());
        $(initErp());
    </script>
</block>